
	var entityId=taskId;
    var url=window.rootPath+'/ui/task/'+taskId;
	jQuery('.app-btn-pass').on('click',function(){
		 jQuery('#loadingImage').show();		 
	jQuery.ajax({
					url:encodeURI(url),
					method:"post",
					data:JSON.stringify({
											"auditState":"通过",
											"auditAdvice":jQuery('#auditAdvice').val(),												
											"taskId":taskId								
								
											}),
					contentType:'application/json;charset=utf-8',
					dataType:'json',
					success:function(){
				 									jQuery('#loadingImage').hide();
													window.location=window.rootPath+'/ui/index';
								}
							});	
	});
  jQuery('.app-btn-reject').on('click',function(){
	 jQuery('#loadingImage').show();		
	jQuery.ajax({
					url:encodeURI(url),
					method:"post",
					data:JSON.stringify({									
											"auditState":"驳回",
											"auditAdvice":jQuery('#auditAdvice').val(),												
											"taskId":taskId								
											}),
					contentType:'application/json;charset=utf-8',
					dataType:'json',
					success:function(data){
				 									jQuery('#loadingImage').hide();										
				 									window.location=window.rootPath+'/ui/index';	
								}
							});	
	});
	//三包零件赔偿表datatable
  var serverData = {};
  serverData.ticketId =$("#ticketId").val();
  var serverTable;
  jQuery(document).ready(function () {
  	
      serverTable = jQuery('#payDeviceViewTable').DataTable({
          "serverSide": true,
          "ordering": false,
          "ajax": {
              "dataType": "json",
              "type": "get",
              "cache": false,
              "url":window.rootPath+ '/ui/afterSaleInHouse/getPayDevicePage',
              "data": function (d) {
                  return $.extend({}, d, serverData);
              }
          },
          "iDisplayLength": 5,
          columns: [
              {
              data: null
              },
              {
                  data: 'partName'
              },
              {
                  data: 'figureNumber'
              },
              {
                  data: 'quantity'
              },
              {
                  data: 'material',
                  
              },
              {
                  data: 'price',
                  
              },
              {
                  data: 'sumPrice',
                  
              },
              {
                  data: 'deviceMemo',
                  
              } 
            ],
          "drawCallback": function (oSettings) {
              var k = 0;
              var total = oSettings.aiDisplay.length + oSettings._iDisplayStart;

              for (var i = oSettings._iDisplayStart, iLen = total; i < iLen; i++) {
                  $('td:eq(0)', oSettings.aoData[oSettings.aiDisplay[k]].nTr).text(i + 1);
                  k++;
              }

          }
      });
  	});


